package kr.hkit.myframework.uicompent;

import javax.swing.JPanel;

import java.awt.GridLayout;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class InputPanel extends JPanel {
	private JTextField tf;
	private JLabel lbl;
	/**
	 * Create the panel.
	 */
	public InputPanel() {
		initialize();
	}
	
	public InputPanel(String lblStr){
		initialize();
		lbl.setText(lblStr);
	}
	
	private void initialize() {
		setLayout(new GridLayout(0, 2, 0, 0));
		
		lbl = new JLabel("New label");
		lbl.setHorizontalAlignment(SwingConstants.CENTER);
		add(lbl);
		
		tf = new JTextField();
		add(tf);
		tf.setColumns(10);
	}

	/*public String getTf() {
		return tf.getText();
	}밑에걸로 바꿈,패널안에 라벨과 텍스트필드과함께 있다.
	하지만 원하는것은 텍스트필드의 활성화이므로*/
	public JTextField getTf() {
		return tf;
	}
	public void setTf(String tfStr) {
		this.tf.setText(tfStr);
	}

	
}
